//package com.li.config;
//
//
//import javax.servlet.http.HttpSession;
//import javax.websocket.HandshakeResponse;
//import javax.websocket.server.HandshakeRequest;
//import javax.websocket.server.ServerEndpointConfig;
//
//public class GetHttpSessionConfigurator extends ServerEndpointConfig.Configurator {
//    @Override //sec对象和onOpen(Session session, EndpointConfig config)中的config是同一个对象
//    public void modifyHandshake(ServerEndpointConfig sec, HandshakeRequest request, HandshakeResponse response) {
//        HttpSession httpSession =(HttpSession)request.getHttpSession();
//        //httpSession对象存储到配置对象中
//        sec.getUserProperties().put(HttpSession.class.getName(),httpSession);
//    }
//}
